package com.edu.service.impl;

import com.edu.service.BookService;

public class BookServiceProxy implements BookService {

    private BookService bs;

    public BookServiceProxy(BookService bs) {

        this.bs = bs;

    }

    @Override
    public void selectBook() {
        long start = System.currentTimeMillis();
        bs.selectBook();
        long end = System.currentTimeMillis();
        System.out.println("方法执行用时:"+(end - start));
    }

    @Override
    public void addBook() {
        long start = System.currentTimeMillis();
        bs.addBook();
        long end = System.currentTimeMillis();
        System.out.println("方法执行用时:"+(end - start));
    }

    @Override
    public void deleteBook() {
        long start = System.currentTimeMillis();
        bs.deleteBook();
        long end = System.currentTimeMillis();
        System.out.println("方法执行用时:"+(end - start));
    }

    @Override
    public int updateBook() {
        long start = System.currentTimeMillis();
        bs.updateBook();
        long end = System.currentTimeMillis();
        System.out.println("方法执行用时:"+(end - start));
        return 1;
    }

    @Override
    public void selectAll() {
        bs.selectAll();
    }
}
